home *** CD-ROM | disk | FTP | other *** search
/ Programmer Plus 2007 / Programmer-Plus-2007.iso / Programming / XML Utilities / Professional Programmer XSL IDE / Xselerator25.msi / Data.Cab / F30620_strfoldl.xsl < prev    next >
Encoding:
Extensible Markup Language  |  2001-11-28  |  1.1 KB  |  29 lines

  1. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  2.     <xsl:template name="str-foldl">
  3.       <xsl:param name="pFunc" select="/.."/>
  4.       <xsl:param name="pA0"/>
  5.       <xsl:param name="pStr"/>
  6.  
  7.       <xsl:choose>
  8.          <xsl:when test="not(string($pStr))">
  9.             <xsl:copy-of select="$pA0"/>
  10.          </xsl:when>
  11.          <xsl:otherwise>
  12.             <xsl:variable name="vFunResult">
  13.               <xsl:apply-templates select="$pFunc[1]">
  14.                 <xsl:with-param name="arg0" select="$pFunc[position() > 1]"/>
  15.                 <xsl:with-param name="arg1" select="$pA0"/>
  16.                 <xsl:with-param name="arg2" select="substring($pStr,1,1)"/>
  17.               </xsl:apply-templates>
  18.             </xsl:variable>
  19.  
  20.             <xsl:call-template name="str-foldl">
  21.                 <xsl:with-param name="pFunc" select="$pFunc"/>
  22.                 <xsl:with-param name="pStr" select="substring($pStr,2)"/>
  23.                 <xsl:with-param name="pA0" select="$vFunResult"/>
  24.             </xsl:call-template>
  25.          </xsl:otherwise>
  26.       </xsl:choose>
  27.  
  28.     </xsl:template>
  29. </xsl:stylesheet>